package net.monare.mifss.evn;

import com.vaadin.ui.UI;
import net.monare.mifss.admin.ui.win.ConfigureApiKeyWindow;
import net.monare.mifss.admin.ui.win.ConfigureStorageWindow;
import net.monare.mifss.configurations.pojo.ApiKey;

import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;

public class ConfigureSelectedApiKeyListener implements ClickListener {

	private static final long serialVersionUID = -1617118953782663760L;

	private final ConfigureStorageWindow parent;
	private final ApiKey apiKey;

	public ConfigureSelectedApiKeyListener(ConfigureStorageWindow parent, ApiKey apiKey) {
		this.apiKey = apiKey;
		this.parent = parent;
	}

	public void buttonClick(ClickEvent event) {
        UI.getCurrent().addWindow(new ConfigureApiKeyWindow(parent, apiKey, parent.getCurrentStorageDef()));
	}

}
